﻿<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <link rel="shortcut icon" href="#"/>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>Summer ${user.uname}</title>
    <link type="text/css" rel="stylesheet" href="css/style.css"/>

    <script type="text/javascript" src="js/jquery-1.12.4.min.js"></script>
    <script type="text/javascript" src="js/my.js"></script>
</head>

<body>
<div class="topDiv">
</div>
<div class="loginDiv">
    <div class="loginL">
        <img src="images/LOGO.png"/>
        <img src="images/view_logo40.png"/>
    </div>
    <div class="loginAddress">
        <div class="add1">
        </div>
    </div>
    <div class="loginC">
        <input id="jobKeys" value="" name="" type="text" placeholder="请填写关键词或选择职位..."/>
        <button id="search_btn"></button>
    </div>
    <div class="loginR">
        <img src="images/spirit_40.png"/>
    </div>

</div>
<div class="menuDiv">
    <a href="index.jsp" class="onnav">首页</a>
    <a href="personal_resume.jsp">个人中心</a>
    <a href="personal_selected.jsp">我的职位</a>
</div>
<div class="BodyMain">
    <div class="mainTop">
        <div class="mainTopL">
            <ul>
                <div class="items">
                    <div class="itemOne">
                        <span class="itme1"><b></b><a>销售</a>|<a>市场</a>|<a>客服</a>|<a>贸易</a></span>

                    </div>
                </div>
                <div class="items">
                    <div class="itemOne">
                        <span class="itme2"><b></b><a>经营管理</a>|<a>人事</a>|<a>行政</a>|<a>财务</a></span>
                    </div>
                </div>
                <div class="items">
                    <div class="itemOne">
                        <span class="itme3"><b></b><a>生产</a>|<a>质管</a>|<a>技工</a>|<a>物流</a></span>
                    </div>
                </div>
                <div class="items">
                    <div class="itemOne">
                        <span class="itme4"><b></b><a>教育</a>|<a>法律</a>|<a>咨询</a>|<a>翻译</a></span>
                    </div>
                </div>
                <div class="items">
                    <div class="itemOne">
                        <span class="itme5"><b></b><a>零售</a>|<a>家政</a>|<a>餐饮</a>|<a>旅游</a></span>
                    </div>
                </div>
                <div class="items">
                    <div class="itemOne">
                        <span class="itme6"><b></b><a>广告</a>|<a>媒体</a>|<a>艺术</a>|<a>出版</a></span>
                    </div>
                </div>
                <div class="items">
                    <div class="itemOne">
                        <span class="itme7"><b></b><a>IT</a>|<a>互联网</a>|<a>通信</a></span>
                    </div>
                </div>
            </ul>
        </div>
        <div class="mainTopR">
            <div class="ads">
                <div class="floatL" id="left"></div>
                <div class="adBox0">
                    <ul style="margin-left: 0px; overflow: hidden">
                        <li>
                            <a href="javascript:void(0)">
                                <div style="background:url(images/1.jpg);background-size: cover;background-repeat: no-repeat;background-position: center"></div>
                            </a>
                        </li>
                        <li>
                            <a href="javascript:void(0)">
                                <div style="background:url(images/2.jpg);background-size: cover;background-repeat: no-repeat;background-position: center"></div>
                            </a>
                        </li>
                        <li>
                            <a href="javascript:void(0)">
                                <div style="background:url(images/3.gif);background-size: cover;background-repeat: no-repeat;background-position: center"></div>
                            </a>
                        </li>
                    </ul>
                </div>
                <div class="clear"></div>
            </div>
            <div id="loginblock" class="login">
                <div id="erwwma" class="erweima">
                    <div class="close">
                        <div class="ewmimg"><img src="images/showqrcode.jpg"/></div>
                        <div class="ewmtxt">使用微信扫描上方二维码登录</div>
                    </div>
                </div>
                <div  class="logintop">
                    <div id="personalLogin" class="loginC loginA select">
                        <span>个人登录</span>
                    </div>
                    <div id="TwoDimensionalCode" class="loginC loginB">
                        <span>二维码登录</span>
                    </div>
                </div>
                <div id="LoginMode" class="loginmain">
                    <div class="ContentA">
                        <div class="txtInput"><input id="userAccount" name="" type="text" placeholder="请输入用户名"/></div>
                        <div class="txtInput"><input id="upassword" name="" type="text" placeholder="请输入密码"/></div>
                        <div class="txtbtn">
                            <div style="float:left">
                                <br/>
                                <div class="clear"></div>
                                <a href="password.jsp" class="a2">忘记密码</a>
                            </div>
                            <input id="loginButton" name="" type="button" class="lobtn" value="登  录"/>
                        </div>
                        <div class="zcbox">
                            <div class="zc2">
                                <a href="resume.jsp" class="a1">一分钟填写简历</a>
                                <a href="register.jsp" class="a2">注册</a>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="clear"></div>
        </div>
    </div>
    <div class="clear"></div>
    <div class="mainCon2">
        <div class="commontitdiv">
            <div class="title">高薪职位</div>
            <span>高薪就这么任性！</span>
        </div>
        <div class="clear"></div>
        <div id="jobList" class="highMoney">

        </div>
    </div>
    <div class="clear"></div>
</div>
<div class="footerLine"></div>
<div class="footer">
    <div class="footerdown">
    </div>
</div>
</body>
<script type="text/javascript" src="https://code.jquery.com/jquery-3.1.1.min.js"></script>

<script type="text/javascript">
    var regemial = new RegExp("^[a-z0-9]+([._\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$");
    var regphone = new RegExp("^((13[0-9])|(14[5,7])|(15[0-3,5-9])|(17[0,3,5-9])|(18[0-9])|166|198|199|191|(147))\\d{8}$");

    $(function () {
        $("#search_btn").on("click", function () {
            window.location.replace("searchJob.jsp?keyword=" + $("#jobKeys").val())
        });
    });


    $(document).ready(function () {
            var user = "${user.uid}";
            if (user != "") {
                $("[id='loginblock']").empty();
                var obj =
                    "<div  class='MyHeadpicture'>" +
                    "<img src='images/miHoYo.jpg' alt='logo'>" +
                    "</div>";
                $(obj).appendTo($("[id='loginblock']"));
            }
            $.get("getjobAll.do", function (str) {
                eval("var list=" + str);
                var uid = "${user.uid}";
                for (var i = 0; i < list.length; i++) {
                    var obj = "<div class='divBox'>" +
                        "<a href='getOnejobByJid.do?uid=" + uid + "&jid=" + list[i].jid + "'><img src='images/18.gif' width='84'/></a>" +
                        "<p class='tit'><a href='getOnejobByJid.do?uid=" + uid + "&jid=" + list[i].jid + "'>" + list[i].jname + "</a></p>" +
                        "<p class='sub'><a href='company.do?eid=" + list[i].enterprise.eid + "'>" + list[i].enterprise.ename + "</a></p>" +
                        "<p class='num'><span>" + list[i].jmonthsalary + "</span></p>" +
                        "</div>" +
                        "<div class='lineBox'></div>";
                    $(obj).appendTo($("[id='jobList']"));
                }

            });
            $("[id='loginButton']").click(function () {
                var uname = "";
                var uphone = "";
                var uemail = "";
                var NameEmailPhone = $("[id='userAccount']").val();
                var upassword = $("[id='upassword']").val();
                if (NameEmailPhone != null && upassword != null) {
                    if (regphone.test(NameEmailPhone)) {
                        uphone = NameEmailPhone;
                    } else if (regemial.test(NameEmailPhone)) {
                        uemail = NameEmailPhone
                    } else {
                        uname = NameEmailPhone;
                    }
                    $.get("loginCheckUser.do",
                        "uname=" + uname +
                        "&uphone=" + uphone +
                        "&uemail=" + uemail +
                        "&upassword=" + upassword, function (str) {
                            if (str == "" ||str==null) {
                                alert("用户名或密码错误")
                            } else {
                                window.location.replace("index.jsp")
                            }
                        })
                } else {
                    window.confirm("用户名/邮箱/手机号/密码 不能为空")
                }

            })

            $(document).on("click", "a", function () {
                var keyword = $(this).html()
                window.location.replace("searchJob.jsp?keyword=" + keyword);
            });

            $("[id='TwoDimensionalCode']").click(function () {
                $("#erwwma").show();
                $("#LoginMode").hide();
                $("[id='TwoDimensionalCode']").addClass('select');
                $("[id='personalLogin']").removeClass('select');
            })
            $("[id='personalLogin']").click(function () {
                $("#erwwma").hide()
                $("#LoginMode").show();
                $("[id='TwoDimensionalCode']").removeClass('select');
                $("[id='personalLogin']").addClass('select');
            })
        }
    );
</script>
</html>
